#ifndef __GLF_CORE_SEMAPHORE_H_INCLUDED__
#define __GLF_CORE_SEMAPHORE_H_INCLUDED__

#include <glf/config.h>
namespace glf {

struct Semaphore : private NonCopyable {
	Semaphore(unsigned int initialValue, unsigned int maxValue);
	~Semaphore(); //virtual ?

	//! Wait for a token to be available, then wakeup and consume the token 
	int Wait();
	//! Consume a token is available, otherwise return error (<0)
	int TryWait();
	//! Add a token to the semaphore, if under the max value
	int Post();

	GLF_DECLARE_IMPL(104)//to check
};

} //namespace glf

#endif
